package com.shangcheng.goods.feign;


import com.shangcheng.goods.pojo.Sku;
import entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "goods")
@RequestMapping("/sku")
public interface SkuFeign {
    /**
     * 搜索
     *
     * @param searchMap
     * @return
     */
    @RequestMapping
    Map search(@RequestParam(required = false) Map searchMap);

    /**
     * 根据条件搜索
     *
     * @param sku
     * @return
     */
    @RequestMapping(value = "/findList")
    public Result<List<Sku>> findList(@RequestBody(required = false) Sku sku);

    @RequestMapping(value = "/{id}")
    public Result<Sku> findById(@PathVariable(name = "id") Long id);

    /**
     * 更新库存
     *
     * @param username
     * @return
     */
    @RequestMapping("/decr")
    Result decr(@RequestParam(value = "username") String username);


}
